package org.parademo.database;

import org.parademo.model.MemberEntity;
import org.parademo.model.ProposalEntity;
import org.parademo.model.VoteEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * Data storage and access methods.
 * @author Ajit Skanda
 * @version 1.0
 */
public interface DataStorage {

    /**
     * User related methods.
     */
    public MemberEntity getUser(String userName);

    public List<MemberEntity> getUsers(ArrayList<String> userIds);


    /**
     * Proposal related methods.
     */
    public ProposalEntity createProposal(ProposalEntity proposalToCreate);

    public ProposalEntity updateProposal(ProposalEntity proposalToUpdate);

    public void deleteProposal(ProposalEntity proposalToDelete);

    public ProposalEntity getProposal(Long proposalId);

    public List<ProposalEntity> getProposalsForIDs(ArrayList<Long> proposalIds);

    /**
     * Vote related methods.
     */
    public void castVote(VoteEntity vote);

    public void removeVote(VoteEntity vote);

    public void delegateVote(VoteEntity vote);

}
